<template>
  <t-dialog
    :header="`${header}-成果详情`"
    :visible.sync="visible"
    :onClose="closeDialog"
    :closeOnOverlayClick="false"
    :confirmBtn="null"
    width="80%"
    top="5%"
  >
    <div style="height: 65vh">
      <t-tabs v-model="value" size="medium" placement="left">
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="1" label="成果信息">
          <thesis-detail v-if="achievementType === '1'" :objId="objId"></thesis-detail>
          <patent-detail v-else-if="achievementType === '2'" :objId="objId"></patent-detail>
          <treatise-detail v-else-if="achievementType === '3'" :objId="objId"></treatise-detail>
          <copyright-detail v-else-if="achievementType === '4'" :objId="objId"></copyright-detail>
          <awards-detail v-else-if="achievementType === '5'" :objId="objId"></awards-detail>
          <standard-detail v-else-if="achievementType === '6'" :objId="objId"></standard-detail>
          <gf-detail v-else-if="achievementType === '7'" :objId="objId"></gf-detail>
          <other-detail v-else-if="achievementType === '8'" :objId="objId"></other-detail>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="2" label="评价信息">
          <evaluate-detail :objId="objId" :achievement-type="achievementType"></evaluate-detail>
        </t-tab-panel>
        <t-tab-panel :class="[reviewOpen?'tab-full-panel':'tab-panel']" value="3" label="推广信息">
          <extend-detail :objId="objId" :achievement-type="achievementType"></extend-detail>
        </t-tab-panel>
      </t-tabs>

    </div>
  </t-dialog>
</template>

<script>
import thesisDetail from "../thesis/components/thesis-detail.vue";
import PatentDetail from "../patent/components/patent-detail.vue";
import TreatiseDetail from "../treatise/components/treatise-detail.vue";
import CopyrightDetail from "../copyright/components/copyright-detail.vue";
import awardsDetail from "../awards/components/awards-detail.vue";
import standardDetail from "../../bzh/standard/components/standard-detail.vue";
import gfDetail from "../gf/components/gf-detail.vue";
import otherDetail from "../other/components/other-detail.vue";
import evaluateDetail from "../evaluate/components/evaluate-detail.vue";
import extendDetail from "../extend/components/extend-detail.vue";

export default {
  name: "treatise-detail-dialog",
  components:{
    thesisDetail,
    PatentDetail,
    TreatiseDetail,
    CopyrightDetail,
    awardsDetail,
    otherDetail,
    gfDetail,
    standardDetail,
    evaluateDetail,
    extendDetail
  },
  props:{
    objId: [String,Number],
    achievementType: String,
    header: String,
    reviewOpen: {
      type: Boolean,
      default: false
    },
  },
  data(){
    return {
      visible: true,
      value:"1",
    }
  },
  methods:{
    closeDialog() {
      this.$emit("update:visible", false);
    },
  }
}
</script>

<style lang="less" scoped>
.t-tab-panel{
  padding: 10px;
}
.tab-panel{
  height: calc(65vh - 64px);
  overflow: scroll;
}
.tab-full-panel{
  height: calc(80vh - 64px);
  overflow: scroll;
}
.t-form__item{
  margin-bottom:6px
}

.t-row {
  margin-bottom: 14px;
}

.step-card {
  height: 100%;
  margin-bottom: 14px;
}
</style>
